﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;

namespace SCOSub
{
    class BMPOpera
    {
        public static void Resize(Bitmap b, Bitmap tb, Size target)
        {
            if (tb == null)
                return;
            if (b.Size.Width == target.Width && b.Size.Height == target.Height)
            {
                tb = b;
                return;
            }
            using (Graphics g = Graphics.FromImage(tb))
            {
                g.InterpolationMode = InterpolationMode.High;
                g.DrawImage(b, 0, 0, tb.Size.Width, tb.Size.Height);
            }

        }
    }
}
